
import { defineComponent, PropType, ref, watch } from 'vue'
const excludeItems = ['selection', 'index', 'operation']
export default defineComponent({
  name: 'ConfFormColumn',
  props: {
    options: {
      type: Array,
      default: () => {
        return []
      },
    },
    data: {
      type: Object,
      default: {}
    }
  },
  setup(props) {
    return () => props.options.map(opt => {
      if (!excludeItems.includes(opt.type)) {
        if (opt.slot) {
          return (
            <el-form-item label={opt.label}>
              {{
                default: () => opt.slot(opt, props.data)
              }}
            </el-form-item>
          )
        } else {
          return (
            <el-form-item label={opt.label}>
              {props.data[opt.prop]}
            </el-form-item>
          )
        }
      }
    }

    )
  },
})
